<!-- 共用的文章列表部分 -->
<div class="list-group">
    {% if posts %}
        {% for post in posts %}
        <div class="list-group-item card">
            <div class="card-body1">
                <h5 class="card-title">
                    <a href="{{ url_for('blog.post_detail', post_id=post.id) }}" class="text-decoration-none">
                        {{ post.title }}
                    </a>
                </h5>
                
                <div class="card-text post-content">
                    {% if post.formatted_content %}
                        {{ post.formatted_content[:100]|safe }}...
                    {% else %}
                        {{ post.content|truncate(100) }}...
                    {% endif %}
                </div>
                
                <div class="post-meta mt-2">
                    <small class="text-muted">
                        <i class="fas fa-calendar"></i> {{ post.timestamp.strftime('%Y-%m-%d %H:%M') }}
                        {% if post.category %}
                            <i class="fas fa-folder ms-2"></i> {{ post.category.name }}
                        {% endif %}
                    </small>
                </div>
            </div>
        </div>
        {% endfor %}
    {% else %}
        <div class="alert alert-info">暂无文章</div>
    {% endif %}
</div>